<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>临时用户充值</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 Bootstrap -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/statics/js/jquery-3.6.0.js"></script>
    <style>
        input{
            margin-bottom: 8px;
        }
    </style>
</head>
<body>
<jsp:include   page="menu.jsp" flush="true"/>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-6 column">
            <div class="page-header">
                <h1>
                    <small>临时用户充值</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-md-9 column" style="float: left">
        <form  class="form1" action="${pageContext.request.contextPath}/tempUser/updateTempUser" method="post">
            <input type="hidden" name="tempUserID" value="${tempUser.getTempUserID()}"/>
            <div class="row">
                <div class="col-md-2 column" >
                    身份证号：
                </div>
                <div class="col-md-4 column" >
                    <input type="text" name="tempUserNo" id="tempUserNo" value="${tempUser.getTempUserNo()}" class="form-control" readonly="true">
                </div>
                <div class="col-md-3 column">
                    <span id="tempUserNo1" style="display:none;color:red">请输入身份证号</span>
                </div>
            </div>
            <div style="margin:10px"></div>
            <div class="row">
                <div class="col-md-2 column" >
                    网费:
                </div>
                <div class="col-md-4 column" >
                    <input type="text" name="tempUserCost"  id="tempUserCost" value="${tempUser.getTempUserCost()}" class="form-control">
                </div>
                <div class="col-md-3 column">
                    <span id="tempUserCost1" style="display:none;color:red">请输入网费</span>
                </div>
            </div>
            </br>

            </br>
            <input type="button" onclick="checkForm()" value="充值" class="btn btn-primary"/>
        </form>
    </div>
</div>
</body>

<script type="text/javascript">
    var flag5 = true;
    function checkForm(){
        if($("#tempUserCost").val() == ""){
            $("#tempUserCost1").show();
            flag5 = false;
        }else{
            $("#tempUserCost1").hide();
            flag5 = true;
        }
        if(flag5){
            $(".form1").submit();
            return true;
        }else{
            return false;
        }
        return flag5;
    }
</script>
</html>